# coding:utf-8
# 作者：理想国真恵玩
import numpy as np

# 生成2个学生的随机5门成绩
score = np.random.randint(40, 100, [2, 5])
print(score)

# 及格赋值为1，不及格赋值为0
test_score = np.where(score >= 60, 1, 0)
print(test_score)

# 大于80且小于90赋值为1，否则0
test_score1 = np.where(np.logical_and(score > 80, score < 90), 1, 0)
print(test_score1)

# 大于90或者小于60赋值为0，否则为1
test_score2 = np.where(np.logical_or(score > 90, score < 60), 0, 1)
print(test_score2)
